package com.cskaoyan.crud;

import com.cskaoyan.bean.Student;
import com.cskaoyan.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

/**
 * 创建日期: 2022/11/22 17:25
 *
 * @author ciggar
 */
public class SelectDemo {

    public static void main(String[] args) {

        // 1. 获取Sqlsession
        SqlSession sqlSession = MybatisUtils.getSqlSession();

        // 2. 执行SQL语句
//        Student student = sqlSession.selectOne("cskaoyan.selectStudentById", 2001);

//        System.out.println(student);

        String name = sqlSession.selectOne("cskaoyan.selectNameById", 2001);

        System.out.println(name);
    }

}
